package com.example.viewtest;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.viewtest.ActivityGroup.DiaLogActivity;
import com.example.viewtest.ActivityGroup.JSONActivity;
import com.example.viewtest.ActivityGroup.ListViewMain;
import com.example.viewtest.ActivityGroup.MagicIndictaorActivity;
import com.example.viewtest.ActivityGroup.RecycleViewActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button button1 = this.findViewById(R.id.toListView);
        Button button2 = this.findViewById(R.id.toRecycleView);
        Button button3 = this.findViewById(R.id.toMagicIndictaor);
        Button button4 = this.findViewById(R.id.toDiaLog);
        Button button5 = this.findViewById(R.id.toJSONActivity);

        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, ListViewMain.class);
                startActivity(intent);
            }
        });

        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, RecycleViewActivity.class);
                startActivity(intent);
            }
        });

        button3.setOnClickListener(v -> {
            Intent intent = new Intent(MainActivity.this, MagicIndictaorActivity.class);
            startActivity(intent);
        });

        button4.setOnClickListener(v -> {
            Intent intent = new Intent(MainActivity.this, DiaLogActivity.class);
            startActivity(intent);
        });

        button5.setOnClickListener(v -> {
            Intent intent = new Intent(MainActivity.this, JSONActivity.class);
            startActivity(intent);
        });
    }
}